<template>
  <div>
    <div class="ht51">
      <div class="ht52" v-for="(it, i) in topMovie" :key="it">
        <el-card class="ht53">
          <div class="ht54" v-if="i == 0">
            <el-image class="ht55" :src="one" fit="fill"></el-image>
          </div>
          <div class="ht54" v-else-if="i == 1">
            <el-image class="ht55" :src="two" fit="fill"></el-image>
          </div>
          <div class="ht54" v-else-if="i == 2">
            <el-image class="ht55" :src="three" fit="fill"></el-image>
          </div>
          <div class="ht54" v-else>
            <span class="ht56"
              ><b>{{ i + 1 }}</b></span
            >
          </div>
          <div class="ht54" v-if="i == 0">
            <span class="ht57"
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="ht54" v-else-if="i == 1">
            <span class="ht58"
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="ht54" v-else-if="i == 2">
            <span class="ht59" 
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="ht54" v-else>
            <span class="ht510" 
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="ht511">
            <div class="ht512">
              <div class="ht513">
                <span class="ht514"><b>导演:</b>{{ it.director }}</span>
              </div>
              <div  class="ht513">
                <span class="ht514"><b>主演:</b>{{ it.mrole }}</span>
              </div>
              <div  class="ht513">
                <span class="ht514"><b>类型:</b>{{ it.mtype }}</span>
              </div>
            </div>
            <div clas="ht515">
              <div>
                <div v-if="it.rate >= 4">
                  <span class="ht516"
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <div v-else-if="it.rate >= 3">
                  <span class="ht517"
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <div v-else>
                  <span class="ht518"
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <el-rate v-model="it.rate" disabled text-color="#ff9900" v-if="it.rate <= 5">
                </el-rate>
                <el-rate v-model="val5" disabled text-color="#ff9900" v-else> </el-rate>
              </div>
            </div>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'
import '@/assets/scss/userCom/hotTop5.scss'
const topMovie = ref()
const one = require('@/assets/img/no1.webp')
const two = require('@/assets/img/no2.webp')
const three = require('@/assets/img/no3.webp')
const val5 = 5
onMounted(() => {
  axios.get('/api/movie/getTop5Movie').then((res) => {
    topMovie.value = res.data
  })
})
</script>
